package com.wmb.bean;

import java.util.List;

public class Blog {

    //一对一的映射（将诶那个一个类作为变量，与之进行关联），先确定是哪两个表之间，Author表被包含在Blog表中，所以Blog作为主表
    private Author author;


    // 一对多的映射关系（组合关系）,将来作为列表的类型，确定一端和多端，Blog作为一端，是主表
    private List<Post> posts;


    private Integer author_id;

    private String title;

    private Integer authorId;

    public Integer getId() {
        return author_id;
    }

    public void setId(Integer id) {
        this.author_id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title == null ? null : title.trim();
    }

    public Integer getAuthorId() {
        return authorId;
    }

    public void setAuthorId(Integer authorId) {
        this.authorId = authorId;
    }

    public Author getAuthor() {
        return author;
    }

    public void setAuthor(Author author) {
        this.author = author;
    }

    public List<Post> getPosts() {
        return posts;
    }

    public void setPosts(List<Post> posts) {
        this.posts = posts;
    }

    public Integer getAuthor_id() {
        return author_id;
    }

    public void setAuthor_id(Integer author_id) {
        this.author_id = author_id;
    }

    @Override
    public String toString() {
        return "Blog{" +
                "author=" + author +
                ", posts=" + posts +
                ", author_id=" + author_id +
                ", title='" + title + '\'' +
                ", authorId=" + authorId +
                '}';
    }
}